<template>
<!-- 新歌单下的li 内容 -->
  <router-link class="song-item" tag="li" :to="`${path}/${song.id}`">
    <img :src="song.picUrl" />
    <div class="dv-left">
        <p>{{song.name}}</p>
        <p class="dv-left-icon">
            <i class="icon"></i><span>{{song.playCount | formatNum(2)}}</span></p>
    </div> 
    <div class="dv-right"></div>
  </router-link>
</template>
<script>
export default {
   props:{
       song:{  //song是对象
           type:Object,
           default:function(){
               return {}
           }
       },
       path:{
           type:String,
           default:""
       }
   }
}
</script>
<style lang="less" scoped>
.song-item {
    padding: 10px 0px;
    display: flex;
    margin-left: 12px;
    border-bottom: 1px solid rgb(235, 232, 232);
    position: relative;
    img {
        width: 100px;
    }
    .dv-left {
        width: 60%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        margin-left: 10px;
        p {
            font-size: 18px;
            line-height: 50px;
            // 文字多出隐藏样式
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            .icon {
                display: inline-block;
                width: 20px;
                height: 20px;
                color: #000000;
                background: no-repeat
                url(../assets/image/icon_music.png);
                background-size: 17px 17px;
            }
        }
        .dv-left-icon{
            display: flex;
            align-items: center;
        }
    }
    .dv-right{
        width: 10%;
        height: 100px;
        position: absolute;
        right: 0px;  
        z-index: 2;
        color: gray;
        background:no-repeat url('../assets/image/arrow_icon.png');
        background-position: center center;

    }
}
</style>